Vector.Loader = function(){
	var ob = new Ext.util.Observable();
	ob.addEvents('scriptloaded');
	return Ext.apply(ob, {
		loaded:[],
         load: function(uri, callback, scope, args) {
		 	if (this.loaded.indexOf(uri == -1)) {
				var o = Ext.lib.Ajax.getConnectionObject();
				if (!o) {
					return null;
				}
				o.conn.open('GET', uri, false);
				o.conn.send(null);
				Ext.lib.Ajax.handleTransactionResponse(o, {
					success: this.handleSuccess,
					failure: this.handleFailure,
					scope: {
						'script': uri,
						cb: {
							'callback': callback,
							'scope': scope || this,
							'args': args || []
						},
						'scope': this
					}
				});
				this.loaded.push(uri);
			}else{
				if(callback){
					var c = callback.createDelegate(scope || this, args);
					c();
				}
			}
		},
		handleSuccess: function(req){
			eval(req.responseText);
			
			if(this.cb && this.cb.callback){
				var c = this.cb.callback.createDelegate(this.cb.scope, this.cb.args);
				c();
			}
		},
		handleFailure: function(res) {
//			debugger; 	
		}
     });
}();